#ifndef NETPP_BASIS_HPP
#define NETPP_BASIS_HPP

#include <iostream>
#include <map>
#include <functional>
#include "netpp.h"

using namespace std;

const int n_init = -1;

GoString to_gostr(string s){
	return GoString{s.c_str(), s.size()};
}

namespace netpp{
	
	class socket;
	class listener;
	
	//map<string, socket>
	
	class socket{
		public:
			
			virtual void connect(string protocol, string ip){};
			
			virtual string read(){};
			
			virtual socket& operator>>(string &buf){}
			
			virtual void write(string buf){};
			
			virtual socket& operator<<(string data_){}
			
			virtual string get(string index){};
			
			virtual void close(){};
			
			virtual void timeout(int ms){};
			
			virtual void non_blocking(){};
	};
	
	class listener{
		public:
			virtual void bind(
				string addr, 
				function<void(socket*)> callback
			){};
			
			virtual socket* accept(){};
			
			virtual void close(){};
	};
}

#endif//basis.hpp
